import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Association } from './association.component';

import {
  UserRegApprComponent,
  CompanyRegApprComponent,
  ExamRegApprComponent,
  CertRenewApprComponent,
  CertReissueApprComponent,
  UserinfoModifyApprComponent,
  CompanyChangeApprComponent,
  CompMoveApprComponent,
  CertIssueApprComponent,
  ScoreInputComponent,
  CompinfoModifyApprComponent
} from './apply';

import {
  AssoCertManComponent,
  NotificationComponent,
  NotificationListComponent,
  NotificationAddComponent
} from './info-record';

import { PublishManComponent } from './publish';

// noinspection TypeScriptValidateTypes
const routes: Routes = [
  {
    path: '',
    component: Association,
    children: [
      { path: '', redirectTo: 'apply/exra', pathMatch: 'full' },
      { path: 'dashboard', loadChildren: () => System.import('../dashboard/dashboard.module') },
      {
        path: 'apply/ura',
        component: UserRegApprComponent
      },
      {
        path: 'apply/era',
        component: CompanyRegApprComponent
      },
      {
        path: 'apply/exra',
        component: ExamRegApprComponent
      },
      {
        path: 'apply/cra',
        component: CertRenewApprComponent
      },
      {
        path: 'apply/cria',
        component: CertReissueApprComponent
      },
      {
        path: 'apply/uma',
        component: UserinfoModifyApprComponent
      },
      {
        path: 'apply/cima',
        component: CompinfoModifyApprComponent
      },
      {
        path: 'apply/cca',
        component: CompanyChangeApprComponent
      },
      {
        path: 'apply/cma',
        component: CompMoveApprComponent
      },
      {
        path: 'apply/cia',
        component: CertIssueApprComponent
      },
      {
        path: 'record/score-input',
        component: ScoreInputComponent
      },
      {
        path: 'record/cm',
        component: AssoCertManComponent
      },
      {
        path: 'record/publish',
        component: PublishManComponent
      },
      {
        path: 'record/notification',
        component: NotificationComponent,
        children: [
          { path: '', component: NotificationListComponent},
          { path: 'add', component: NotificationAddComponent}
        ]
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class AssociationRoutingModule { }
